# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>

buildarch=4

pkgname=brcm-patchram-plus
pkgver=r1.4070e71
pkgrel=1
pkgdesc="Chromium OS Broadcom patchram utility"
arch=('armv7h')
depends=('bluez-libs')
makedepends=('git')
url='https://chromium.googlesource.com/chromiumos/third_party/broadcom/'
license=('custom:chromiumos')
source=("git+https://chromium.googlesource.com/chromiumos/third_party/broadcom"
        '0001-fix-includes.patch')
md5sums=('SKIP'
         'bb1e24dce6c639ac4ab163eaf81fc3fd')

pkgver() {
  cd broadcom
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd broadcom
  git apply ../0001-fix-includes.patch
}

build() {
  cd broadcom/bluetooth
  make
}

package() {
  cd broadcom/bluetooth
  install -dm755 ${pkgdir}/usr/bin
  install -m755 brcm_patchram_plus ${pkgdir}/usr/bin
}
